from django.contrib import admin
from student.models import StudentInvite
from student.models import StudentInvitePerson
from student.models import StudentInviteVerify
from student.models import StudentModel
from student.models import StudentPerson


@admin.register(StudentModel)
class StudentModelAdmin(admin.ModelAdmin):
    list_display = ("dept", "name", "phone")
    list_filter = ("dept",)
    search_fields = ("name", "phone")
    autocomplete_fields = []


@admin.register(StudentInvite)
class StudentInviteAdmin(admin.ModelAdmin):
    list_display = ("student", "status", "when", "updated")
    list_filter = ("status",)
    search_fields = ("student__name", "student__phone")
    autocomplete_fields = ["student", ]


@admin.register(StudentInvitePerson)
class StudentInvitePersonAdmin(admin.ModelAdmin):
    list_display = ("invite", "person", "updated")
    list_filter = ("invite",)
    search_fields = ("invite__student__name", "invite__student__phone")
    autocomplete_fields = ["invite", "person", ]


@admin.register(StudentInviteVerify)
class StudentInviteVerifyAdmin(admin.ModelAdmin):
    list_display = ("invite", "stage", "status", "teacher", "updated")
    list_filter = ("stage", "status",)
    search_fields = ("invite__student__name", "invite__student__phone")
    autocomplete_fields = ["invite", "teacher", ]
